package com.chushouya.product.dto.admin.tempevaluate;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 模板估价详情DTO
 */
@Data
@ApiModel(value = "模板估价详情DTO")
public class TempEvaluateDetailDTO {

    @ApiModelProperty(value = "模板ID")
    private Long tempId;

    @ApiModelProperty(value = "分类ID")
    private Long categoryId;

    @ApiModelProperty(value = "模板名称")
    private String tempName;

    @ApiModelProperty(value = "计算类型")
    private Integer calcType;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 获取计算类型描述
     */
    public String getCalcTypeDesc() {
        if (calcType == null) {
            return "未知";
        }
        switch (calcType) {
            case 0:
                return "按金额";
            case 1:
                return "按比例";
            default:
                return "未知";
        }
    }
}
